﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucNewMenuParent.ascx.cs"
    Inherits="Admin_ucControl_ucNewMenuParent" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor"
    TagPrefix="cc1" %>
<!-- tao thanh cuon-->

<script type="text/javascript">
    function s() {
        var t = document.getElementById("<%=grdMenuParent.ClientID%>");
        var t2 = t.cloneNode(true)
        for (i = t2.rows.length - 1; i > 0; i--)
            t2.deleteRow(i)
        t.deleteRow(0)
        a.appendChild(t2)
    }
    window.onload = s
</script>

<h1>
    Danh Mục Ứng Dụng</h1>
<br />
<div>
    <asp:HyperLink ID="hyp" runat="server" NavigateUrl="~/Admin/DanhSachSanPham.aspx"
        Font-Size="Medium">Quay lại</asp:HyperLink>
</div>
<br />
<asp:Panel ID="Panel1" runat="server">
    <table class="style2">
        <tr>
            <td valign="top" style="width: 50%; float: left">
                <table style="width: 100%">
                    <tr>
                        <th style="width: 100px">
                            Tên Ứng Dụng
                        </th>
                        <td>
                            <asp:TextBox ID="txttenungdung" runat="server" CssClass="inp-form"></asp:TextBox>
                            &nbsp;<asp:RequiredFieldValidator ID="reqCatename" runat="server" ControlToValidate="txttenungdung"
                                Text="*" Font-Bold="True" ForeColor="Red" ValidationGroup="save"></asp:RequiredFieldValidator><asp:Label
                                    ID="lb_message" runat="server" ForeColor="Red"></asp:Label></td>
                    </tr>
                    <tr>
                        <th>
                            Mô tả ứng dụng
                        </th>
                        <td>
                            <%--<cc1:Editor ID="txtDescription" runat="server" />--%>
                            <cc1:Editor ID="txtDescription" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            <asp:Button ID="btAdd" runat="server" Text="Save" OnClick="btAdd_Click" ValidationGroup="save" />
                        </td>
                    </tr>
                </table>
            </td>
            <td valign="top" style="float: right; padding-left: 20px">
                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                        <td>
                            <div id="a">
                            </div>
                            <div style="overflow-y: scroll; height: 360px">
                                <asp:GridView ID="grdMenuParent" runat="server" CellPadding="3" AutoGenerateColumns="False"
                                    BackColor="White" BorderColor="#CCCCCC" BorderStyle="None"
                                    BorderWidth="1px" ShowFooter="True" Width="550px" >
                                    <RowStyle ForeColor="#000066" />
                                    <FooterStyle BackColor="White" ForeColor="#000066" />
                                    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                                    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                                    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" Height="35px" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="STT">
                                            <ControlStyle Height="22px" />
                                            <ItemStyle HorizontalAlign="Center" Width="30px" />
                                            <HeaderStyle HorizontalAlign="Center" Width="30px" />
                                            <ItemTemplate>
                                                <asp:Label ID="STT" runat="server" Text="<%# ((grdMenuParent.PageIndex * grdMenuParent.PageSize) + grdMenuParent.Rows.Count + 1)%>"></asp:Label></ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:HyperLinkField DataTextField="MenuParentName" DataNavigateUrlFormatString="~/Admin/AddNewApplications.aspx?id={0}"
                                            HeaderText="Tên ứng dụng" SortExpression="MenuParentName" DataNavigateUrlFields="IDMenu_Parent">
                                            <ItemStyle Width="160px" HorizontalAlign="Center" />
                                            <HeaderStyle Width="160px" HorizontalAlign="Center" />
                                        </asp:HyperLinkField>
                                        <asp:TemplateField HeaderText="Thông tin ứng dụng">
                                            <ControlStyle Height="22px" />
                                            <ItemStyle HorizontalAlign="Center" Width="250px" />
                                            <HeaderStyle HorizontalAlign="Center" Width="250px" />
                                            <ItemTemplate>
                                                <%# Server.HtmlDecode(Eval("MenuDescription").ToString())%>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Delete">
                                            <ItemTemplate>
                                                <asp:ImageButton ID="btnDelImg" runat="server" CausesValidation="false" CommandArgument='<%# Eval("IDMenu_Parent") %>'
                                                    CommandName="delete" ImageUrl="~/Admin/images/table/del.gif" OnClick="btnDelImg_Click" />
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                            </div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Panel>
